		
	<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <ext:ResourceManager ID="ResourceManagerProxy1" runat="server">
    </ext:ResourceManager>
    <script type="text/javascript">
        var rooturl ='<%=this.ResolveUrl("~/")%>';


        function RefreshOrdershippinghistoryData() {
            <%= storeOrdershippinghistory.ClientID %>.reload();
        }
        
        function ShowAddOrdershippinghistory() {
		
            var winAddOrg = <%= winAddOrdershippinghistory.ClientID %>;
         
            winAddOrg.setTitle("添加ordershippinghistory信息'); 
 
           <%= winAddOrdershippinghistory.ClientID %>.show();
        }
                  
        function CloseAddOrdershippinghistory()
        {
            <%= winAddOrdershippinghistory.ClientID %>.hide();
        }

        function CloseEditOrdershippinghistory()
        {
            <%= winEditOrdershippinghistory.ClientID %>.hide();
        }

        var processOrdershippinghistoryid = 0;

        function GetProcessOrdershippinghistoryId() {
            return processOrdershippinghistoryid;
        }
 
        function processOrdershippinghistorycmd(cmd, record) {

            if (cmd == "cmdEdit") {
                var win = <%= winEditOrdershippinghistory.ClientID %>;
                processid = record.internalId;
 
                win.setTitle(Ext.String.format('ordershippinghistory“{0}”编辑', record.data.Name));
                win.show();
            }

           <%--            if (cmd == "cmdView") {
                var win = <%= winOrdershippinghistoryView.ClientID %>;
		processid = record.internalId;
                win.setTitle(String.format('ordershippinghistory“{0}”信息查看', id.data.Name));
                win.show();
            }--%>
 

            if (cmd == "cmdDelete") {
                Ext.MessageBox.confirm('警告', '确认删除ordershippinghistory['+record.data.Name+']？ ',
                    function(e) {
                        if (e == 'yes')
 
                            App.direct.DeleteRecord(
                                record.internalId,
                                {
                                    failure: function(msg) {
                                        Ext.Msg.alert('操作失败', '删除ordershippinghistory['+record.data.Name+']失败'+msg);
                                    },
                                    success: function(result) {
                                        ShowMessage('操作成功','删除ordershippinghistory['+record.data.Name+']成功！',1);
                                        RefreshOrgData();
                                    },
                                    eventMask: {
                                        showMask: true,
                                        msg: '数据处理中。。。'
                                    }
                                }
                            );
                    }
                );
            }
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ext:Viewport ID="ViewPort1" runat="server" Layout="BorderLayout">
        <Items>
 <ext:GridPanel
                ID="gridEmployees" Region="Center"
                runat="server"
                Title="ordershippinghistory管理">
                <Store>
                    <ext:Store ID="storeOrdershippinghistory" runat="server" OnReadData="gridOrdershippinghistory_Refresh" PageSize="10" RemoteSort="true">
                        <Model>
                            <ext:Model runat="server" IDProperty="Id">
                                <Fields>
      <ext:ModelField Name="Id" Type="Int"  />   
      <ext:ModelField Name="OrderId" Type="Int"  />   
      <ext:ModelField Name="Message" Type="String"  />   
      <ext:ModelField Name="CreateDate" Type="Date"  DateFormat="Y-m-d H:i:s"  />   
                               </Fields>
                            </ext:Model>
                        </Model>
						<Sorters>
							<ext:DataSorter Property="Id" Direction="DESC" />
						</Sorters>
                        <Listeners>
                            <BeforeLoad Handler="ShowGirdMask(#{gridOrdershippinghistory},'数据加载中...');"></BeforeLoad>
                            <Load Handler="HideMask()"></Load>
                            <Exception Handler="HideMask()"></Exception>
                        </Listeners>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:RowNumbererColumn runat="server" Width="35" />
						     <ext:Column runat="server" Text="Id" Width="50" DataIndex="Id"></ext:Column>
     <ext:Column runat="server" Text="OrderId" Width="50" DataIndex="OrderId"></ext:Column>
     <ext:Column runat="server" Text="Message" Width="50" DataIndex="Message"></ext:Column>
     <ext:Column runat="server" Text="CreateDate" Width="50" DataIndex="CreateDate"></ext:Column>

						<ext:CommandColumn runat="server" Text="操作" Width="60">
                            <Commands>
                                <ext:SplitCommand Text="选择">
                                    <Menu EnableScrolling="false">
                                        <Items>
                                            <ext:MenuCommand Text="编辑" Icon="TableEdit" CommandName="cmdEdit" />
                                            <ext:MenuCommand Text="删除" Icon="TableDelete" CommandName="cmdDelete">
                                            </ext:MenuCommand>
                                            <ext:MenuCommand Text="查看报表" Icon="ChartBar"></ext:MenuCommand>
                                        </Items>
                                    </Menu>
                                    <ToolTip Text="选择操作" />
                                </ext:SplitCommand>
                            </Commands>
                            <Listeners>
                                <Command Handler="processOrdershippinghistorycmd(command, record);" />
                            </Listeners>
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel runat="server" Mode="Single" />
                </SelectionModel>
                <View>
                    <ext:GridView runat="server" StripeRows="true" />
                </View>

                <BottomBar>
                    <ext:PagingToolbar runat="server">
                        <Items>
                            <ext:Label runat="server" Text="每页数据:" />
                            <ext:ToolbarSpacer runat="server" Width="10" />
                            <ext:ComboBox runat="server" Width="80">
                                <Items>
                                    <ext:ListItem Text="1" />
                                    <ext:ListItem Text="2" />
                                    <ext:ListItem Text="10" />
                                    <ext:ListItem Text="20" />
                                </Items>
                                <SelectedItems>
                                    <ext:ListItem Value="10" />
                                </SelectedItems>
                                <Listeners>
                                    <Select Handler="#{gridOrdershippinghistory}.store.pageSize = parseInt(this.getValue(), 10); #{gridOrdershippinghistory}.store.reload();" />
                                </Listeners>
                            </ext:ComboBox>
                        </Items>
                        <Plugins>
                            <ext:ProgressBarPager runat="server" />
                        </Plugins>
                    </ext:PagingToolbar>
                </BottomBar>
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:Button runat="server" Text="添加ordershippinghistory" Icon="TableAdd" />
                            <ext:Button runat="server" Text="导出ordershippinghistory" Icon="PageExcel" />
                            <ext:Button runat="server" Text="批量导入ordershippinghistory" Icon="PageGo" />
                        </Items>
                    </ext:Toolbar>
                </TopBar>
            </ext:GridPanel>
 
           
        </Items>
    </ext:Viewport>
    <ext:Window ID="winAddOrdershippinghistory" runat="server" Title="Window" Frame="true" Width="640"
        ConstrainHeader="true" Height="380" Maximizable="true" Closable="true" Resizable="true"
        Modal="true" Hidden="true">
        <Loader Url="OrdershippinghistoryAddPage.aspx" Mode="Frame" DisableCaching="True" TriggerEvent="show"
            ReloadOnEvent="true" LoadMask="true" runat="server">
        </Loader>
        <Listeners>
            <Hide Handler="this.clearContent();" />
        </Listeners>
    </ext:Window>

    <ext:Window ID="winEditOrdershippinghistory" runat="server" Title="Window" Frame="true" Width="640"
        ConstrainHeader="true" Height="380" Maximizable="true" Closable="true" Resizable="true"
        Modal="true" Hidden="true">
        <Loader Url="OrdershippinghistoryEditPage.aspx" Mode="Frame" DisableCaching="True" TriggerEvent="show"
            ReloadOnEvent="true" LoadMask="true" runat="server">
            <Params>
                <ext:Parameter Name="Id" Value="GetProcessOrdershippinghistoryId()" Mode="Raw">
                </ext:Parameter>
            </Params>
        </Loader>
        <Listeners>
            <Hide Handler="this.clearContent();" />
        </Listeners>
    </ext:Window>
</asp:Content>




        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.BindData();
            }
        }

        protected void gridOrdershippinghistory_Refresh(object sender, StoreReadDataEventArgs e)
        {
            this.BindData();
        }

        [DirectMethod]
        public void DeleteRecord(int id)
        {
            try
            {
                Global.CurrentServiceContainer.OrdershippinghistoryServiceProxy.DeleteById(id);

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess = false;
                ResourceManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }

        protected void BindData()
        {
            Store store = this.gridOrdershippinghistory.GetStore();

            List<Ordershippinghistory> datas = Global.CurrentServiceContainer.OrdershippinghistoryServiceProxy.QueryAll();

            store.DataSource =datas;
            store.DataBind();
        }
 
 
    }
			
